<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use think\Db;

class Index extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = 'default';

    //首页
    public function index()
    {
        $recmd_data = Db::name('project')->where([
            'show' => 1,
            'recommend' => 1,
            'flag' => ['like','%shop%']
        ])->limit(0,4)->select();
        $this->assign('recmd_data',$recmd_data);
        return $this->view->fetch();
    }

    //网站
    public function web()
    {
        return $this->view->fetch();
    }

    //网站
    public function minapp()
    {
        return $this->view->fetch();
    }

    //商城
    public function shop()
    {
        return $this->view->fetch();
    }

    //微信公众号
    public function wechar()
    {
        return $this->view->fetch();
    }

    //系统
    public function system()
    {
        return $this->view->fetch();
    }

    //关于我们
    public function about()
    {
        return $this->view->fetch();
    }

    //留言
    public function message()
    {
        $params = $this->request->param();
        $insert = [];
        $insert['telephone'] = xykeepFilterSql($params['tel']);
        $insert['username'] = xykeepFilterSql($params['username']);
        $insert['remark'] = xykeepFilterSql($params['title']);
        $insert['createtime'] = time();
        Db::name('message')->insert($insert);
        $this->success('感谢您的留言，稍后我们会有专业的产品经理致电您。');
    }
}
